1. Field of the Invention
The present invention generally relates to digital cameras and other image processing apparatuses, and more particularly, to an image processing apparatus that processes coded data allowing post-quantization such as JPEG 2000 coded data.
2. Description of the Related Art
Generally, in image forming apparatuses, image data are subjected to compression coding prior to recording or transmission of the image data.
Taking an electronic camera device, such as a digital camera, as an example of such image forming apparatuses, in order to improve use efficiency of a recording medium for recording an image, data of a photographed still image or moving image are subjected to compression coding and thereafter recorded on the recording medium. Generally, regarding the compression coding method, JPEG is used for compression coding of a still image and MPEG is used for compression coding of a moving image.
In the compression coding methods such as JPEG, when it is desired to reduce the data amount (to increase the compression rate) of coded data of an image that are already recorded on a recording medium, it is necessary to decode and decompress the coded data and to perform compression coding again on the reproduced image data by varying a quantization parameter or the like. On this occasion, undesirable image degradation occurs. In order to avoid such image degradation caused by recompression (hereinafter referred to as “generation image degradation”), in digital cameras, for example, generally, the compression rate is designated before photographing. Commonly, the compression rate is designated by selecting an image quality mode (high quality, normal, economy, etc.).
However, freedom of choice of a user is significantly limited when compression rates are limited to those corresponding to several image quality modes as mentioned above, though arbitrary compression rates can be achieved in accordance with the degree of quantization in variable length coding methods such as JPEG. For example, even if the compression rate is excessively low in a high image quality mode and the degree of image degradation in a normal mode is not acceptable, a user has no other choice but to select one of the modes. Further, the user has to select the image quality mode in advance of photographing so as to avoid the above-mentioned generation image degradation.
Japanese Laid-Open Patent Application No. 8-339452 discloses an apparatus and a method that do not set a compression rate (that is, a parameter for compression coding) by selecting an image quality mode, but directly set the parameter for compression coding according to JPEG. In the apparatus and the method described in the above-mentioned application, resolution of an image is converted in accordance with a plurality of resolution parameters, images after the resolution conversion are displayed, and a resolution parameter is set when a user selects one of the displayed images. A sub-sampling parameter and a quantization table parameter are also set by the user in similar procedures. Then, compression coding according to JPEG is performed by using all of the parameters that are set, and the coded data are decoded, decompressed and displayed (the corresponding image is displayed). The user confirms acceptability of the setting of each parameter based on the displayed image.
With such apparatus and method, the user can arbitrarily set the parameters for compression coding (accordingly, the compression rate). When JPEG is assumed, however, a working memory having a large capacity is required, which stores original image data or original DCT coefficients at the time of parameter setting.
JPEG 2000 (ISO/IEC FCD 15444-1) and Motion-JPEG 2000 (ISO/IEC FCD 15444-3) are attracting attention as compression coding methods that take the place of JPEG and MPEG (for example, refer to “Next-Generation Image Coding Method JPEG 2000,” Yasuyuki Nomizu, Triceps, Feb. 13, 2001). Motion-JPEG 2000 handles a moving image by assuming each of a plurality of consecutive still images as a frame. In terms of each frame, Motion-JPEG 2000 conforms to JPEG 2000. JPEG 2000 possesses a lot of features. One of the features is that JPEG 2000 allows adjustment of data amount or a compression rate while coded data remain coded by discarding codes of the coded data (post-quantization processing). When the data amount is reduced and the compression rate is increased by post-quantization processing, image degradation due to the increase of the compression rate occurs. However, undesired generation image degradation does not occur, unlike when decoding and decompression is performed and then compression coding is performed again.
Japanese Laid-Open Patent Application No. 2001-320588 discloses a memory management method and an apparatus that provide a free (unused) area of an image memory by performing post-quantization processing on JPEG 2000 coded data by layers, resolution levels, or components. In post-quantization processing, a large capacity working memory is not required since original image data are not used.
As can be appreciated by the foregoing description, in digital cameras and other image forming apparatuses that handle coded data of images, it is desirable for the user to be able to arbitrarily adjust the data amount or the compression rate of coded data. In addition, at the time of adjustment, it is desirable for the user to be able to confirm the degree of image degradation in advance. Also, it is desirable for generation image degradation not to occur due to such adjustment. Further, in digital cameras, for example, at an arbitrary moment before and after photographing, it is desirable to be able to adjust the amount of coded data or the compression rate. Additionally, it is desirable that a large capacity working memory not be required for a process for such adjustment.